Fix exception handling to cope with exceptions that do not have a string as
authorEwan Mellor <ewan@xensource.com>
Tue, 27 Feb 2007 11:19:25 +0000 (11:19 +0000)
committerEwan Mellor <ewan@xensource.com>
Tue, 27 Feb 2007 11:19:25 +0000 (11:19 +0000)
the first argument.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/util/xmlrpclib2.py

index c701020b15d32d02826e3bd1b2139a3cef0550a0..a77b61b5ee0cb47a528a24024059c14c24d60a5e 100644 (file)
@@ -238,8 +238,11 @@ class TCPXMLRPCServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer):
 
 notSupportedRE = re.compile(r'method "(.*)" is not supported')
 def _is_not_supported(exn):
-    m = notSupportedRE.search(exn[0])
-    return m is not None
+    try:
+        m = notSupportedRE.search(exn[0])
+        return m is not None
+    except TypeError, e:
+        return False
 
 
 # This is a XML-RPC server that sits on a Unix domain socket.